package com.zyn.qianwen.user.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {


    private boolean isflag;
    private int code;
    private String message;
    private Object data;


    public static Result SUCCESS(Object data){
        Result result = new Result();
        result.setIsflag(true);
        result.setCode(200);
        result.setMessage("操作成功");
        result.setData(data);
        return result;
    }
    public static Result SUCCESS(){
        Result result = new Result();
        result.setIsflag(true);
        result.setCode(200);
        result.setMessage("操作成功");
        return result;
    }
    public static Result faled(int code ){
        Result result = new Result();
        result.setCode(code);
        result.setMessage("操作失败");
        return result;
    }
    public static Result faled(int code ,String msg ){
        Result result = new Result();
        result.setCode(code);
        result.setMessage(msg);
        return result;
    }
}
